export const hexToRgba = (hex, opacity) => {
    if (!hex) hex = '#ededed';
    return 'rgba(' + parseInt('0x' + hex.slice(1, 3)) + ',' +
        parseInt('0x' + hex.slice(3, 5)) + ',' +
        parseInt('0x' + hex.slice(5, 7)) + ',' +
        (isNaN(opacity) ? 1 : +opacity) + ')';
};
